package com.srwl.mytx.domain;


import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * Created by dahai2070 on 2017/7/31 0031.
 */

public class LiveRecord implements Parcelable {
    private String id;

    //直播间Id
    private String rId;
//直播者id
    private String anchorId;

    private String description;

    //赏金
    private Double reward;
//罚金
    private Double mulct;

    private Double profitRate;//收益分成比率，由系统指定

    private Double donationRate;//直播捐赠比率，由主播在结束播放的时候决定

    private Double donationAmount;//当场直播用户捐赠金额

    private Double userProfit;//用户收益

    private Date created;
    private Date firstMulctTime;
    private Integer audienceSize;
    private Integer duration;
    private int progress;
    private User anchor;
    private Topic bindGoods;
    private List<Reward> giftList;

    public LiveRecord() {
    }

    public LiveRecord(String id, String rId, String anchorId, String description, Double reward, Double mulct, Date created, Integer duration) {
        this.id = id;
        this.rId = rId;
        this.anchorId = anchorId;
        this.description = description;
        this.reward = reward;
        this.mulct = mulct;
        this.created = created;
        this.duration = duration;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getrId() {
        return rId;
    }

    public void setrId(String rId) {
        this.rId = rId;
    }

    public String getAnchorId() {
        return anchorId;
    }

    public void setAnchorId(String anchorId) {
        this.anchorId = anchorId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getReward() {
        return reward;
    }

    public void setReward(Double reward) {
        this.reward = reward;
    }

    public Double getMulct() {
        return mulct;
    }

    public void setMulct(Double mulct) {
        this.mulct = mulct;
    }

    public Double getProfitRate() {
        return profitRate;
    }

    public void setProfitRate(Double profitRate) {
        this.profitRate = profitRate;
    }

    public Double getDonationRate() {
        return donationRate;
    }

    public void setDonationRate(Double donationRate) {
        this.donationRate = donationRate;
    }

    public Double getDonationAmount() {
        return donationAmount;
    }

    public void setDonationAmount(Double donationAmount) {
        this.donationAmount = donationAmount;
    }

    public Double getUserProfit() {
        return userProfit;
    }

    public void setUserProfit(Double userProfit) {
        this.userProfit = userProfit;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getFirstMulctTime() {
        return firstMulctTime;
    }

    public void setFirstMulctTime(Date firstMulctTime) {
        this.firstMulctTime = firstMulctTime;
    }

    public Integer getAudienceSize() {
        return audienceSize;
    }

    public void setAudienceSize(Integer audienceSize) {
        this.audienceSize = audienceSize;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }


    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }

    public User getAnchor() {
        return anchor;
    }

    public void setAnchor(User anchor) {
        this.anchor = anchor;
    }

    public Topic getBindGoods() {
        return bindGoods;
    }

    public void setBindGoods(Topic bindGoods) {
        this.bindGoods = bindGoods;
    }

    public List<Reward> getGiftList() {
        return giftList;
    }

    public void setGiftList(List<Reward> giftList) {
        this.giftList = giftList;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.rId);
        dest.writeString(this.anchorId);
        dest.writeString(this.description);
        dest.writeValue(this.reward);
        dest.writeValue(this.mulct);
        dest.writeLong(this.created != null ? this.created.getTime() : -1);
        dest.writeValue(this.duration);
        dest.writeParcelable(this.anchor, flags);
        dest.writeParcelable(this.bindGoods, flags);
        dest.writeList(this.giftList);
    }

    protected LiveRecord(Parcel in) {
        this.id = in.readString();
        this.rId = in.readString();
        this.anchorId = in.readString();
        this.description = in.readString();
        this.reward = (Double) in.readValue(Double.class.getClassLoader());
        this.mulct = (Double) in.readValue(Double.class.getClassLoader());
        long tmpCreated = in.readLong();
        this.created = tmpCreated == -1 ? null : new Date(tmpCreated);
        this.duration = (Integer) in.readValue(Integer.class.getClassLoader());
        this.anchor = in.readParcelable(User.class.getClassLoader());
        this.bindGoods = in.readParcelable(Topic.class.getClassLoader());
        this.giftList = new ArrayList<Reward>();
        in.readList(this.giftList, Reward.class.getClassLoader());
    }

    public static final Creator<LiveRecord> CREATOR = new Creator<LiveRecord>() {
        @Override
        public LiveRecord createFromParcel(Parcel source) {
            return new LiveRecord(source);
        }

        @Override
        public LiveRecord[] newArray(int size) {
            return new LiveRecord[size];
        }
    };
}
